<html>
<head><meta charset="utf-8"><title>why libserialize · t-compiler/help · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/index.html">t-compiler/help</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/why.20libserialize.html">why libserialize</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="195999691"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/why%20libserialize/near/195999691" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Tshepang Lekhonkhobe <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/why.20libserialize.html#195999691">(May 01 2020 at 19:29)</a>:</h4>
<p>What is it that src/libserialize offer that others don't... why is it still in the codebase?</p>



<a name="196000113"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/why%20libserialize/near/196000113" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/why.20libserialize.html#196000113">(May 01 2020 at 19:32)</a>:</h4>
<p><code>src/libserialize</code> allows specializing the encode/decode implementation for a specific encoder/decoder to get access to extra context. The ones used in rustc are <a href="https://doc.rust-lang.org/nightly/nightly-rustc/rustc_metadata/rmeta/encoder/struct.EncodeContext.html" title="https://doc.rust-lang.org/nightly/nightly-rustc/rustc_metadata/rmeta/encoder/struct.EncodeContext.html"><code>EncodeContext</code></a> and <a href="https://doc.rust-lang.org/nightly/nightly-rustc/rustc_metadata/rmeta/decoder/struct.DecodeContext.html" title="https://doc.rust-lang.org/nightly/nightly-rustc/rustc_metadata/rmeta/decoder/struct.DecodeContext.html"><code>DecodeContext</code></a>, which both include <code>TyCtxt</code>, and several other things.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>